package com.huiquan.icd.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.huiquan.icd.domain.IcdDiseaseNameRecord;
import com.huiquan.framework.base.EnhancedBaseDao;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class IcdDiseaseNameRecordDao extends EnhancedBaseDao<IcdDiseaseNameRecord> {

	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	public static final String space = "ICD_DISEASE_NAME_RECORD.";

	public IcdDiseaseNameRecordDao() {
		super(space);
	}

	public void disableFormerName(String name) {
		Map<String, Object> param = new HashMap<>();
		param.put("formerName", name);
		update(space + "DISABLE_FORMER_NAME", param, sqlMapClient);
	}

	@SuppressWarnings("unchecked")
	public List<String> getFormerNameByCodeImportTemp() {
		return (List<String>)list(space + "GET_FORMER_NAME_BY_CODE_IMPORT_TEMP", sqlMapClient);
	}
}
